package utils

import (
	"log"
	"os"
	"path/filepath"
	"strings"
)

// 获取当前执行程序所在的绝对路径
func GetCurrentAbPathByExecutable() string {
	exePath, err := os.Executable()
	if err != nil {
		log.Fatal(err)
	}
	res, _ := filepath.EvalSymlinks(filepath.Dir(exePath))
	return res
}

// 将win10路径分隔符转为linux
func ConvertLinuxPathSeparator(path string) string {
	return strings.ReplaceAll(path, "\\", "/")
}
